import request from '@/utils/request'

export function findRunningStateLogByAppCode(pageIndex) {
  return request({
    url: 'api/appStatus/findRunningStateLogByAppCode?pageIndex=' + pageIndex,
    method: 'get'
  })
}

export function findNodeByCurrentApp() {
  return request({
    url: 'api/agentDef/findNodeByCurrentApp',
    method: 'get'
  })
}

export function getCurrentAppInf() {
  return request({
    url: 'api/appDef/getCurrentAppInf',
    method: 'get'
  })
}

export function findTaskRunInfCurrentApp() {
  return request({
    url: 'api/ram/findTaskRunInfCurrentApp',
    method: 'get'
  })
}

export function findHisTaskRunInfCurrentApp() {
  return request({
    url: 'api/ram/findHisTaskRunInfCurrentApp',
    method: 'get'
  })
}

export function getCycleJobRunInfCurrentApp() {
  return request({
    url: 'api/ram/getCycleJobRunInfCurrentApp',
    method: 'get'
  })
}

export function findTaskRunResult(data) {
  return request({
    url: 'api/appStatus/findTaskRunResult',
    method: 'post',
    data
  })
}

export function findResAndConNum(data) {
  return request({
    url: 'api/appStatus/findResAndConNum',
    method: 'post',
    data
  })
}

export function getTaskBlockNum(data) {
  return request({
    url: 'api/appStatus/getTaskBlockNum',
    method: 'post',
    data
  })
}

export function initMasterRunningStateLog(pageIndex) {
  return request({
    url: 'api/runningStateLog/initMasterRunningStateLog?pageIndex=' + pageIndex,
    method: 'post'
  })
}

export function findPeriodTaskCountTopData() {
  return request({
    url: 'api/ram/findPeriodTaskCountTopData',
    method: 'get'
  })
}

export function findCronTaskCountTopData() {
  return request({
    url: 'api/ram/findCronTaskCountTopData',
    method: 'get'
  })
}

export default { findRunningStateLogByAppCode, findNodeByCurrentApp, getCurrentAppInf, findTaskRunInfCurrentApp,
  getCycleJobRunInfCurrentApp, findTaskRunResult, findResAndConNum, getTaskBlockNum, initMasterRunningStateLog,
  findHisTaskRunInfCurrentApp, findPeriodTaskCountTopData, findCronTaskCountTopData }
